﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!--#include file="../Include/Config.asp"-->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<%
'----------------------------------------------------------
'页面功能：系统管理页面，问卷信息查看和编辑。
'最后修改时间：2007-11-24 14时35分
'作者：legal http://www.ilegal.cn
'备注：
'----------------------------------------------------------
%>
<link rel="stylesheet" href="../Css/Admin.css" type="text/css" />
<script language="javascript" type="text/javascript" src="../Js/Date.js"></script>
<script language="javascript" type="text/javascript" src="../Js/SurveyAdd.js"></script>
</head>
<body>
<div id="admin_surveyAdd_main">
<%
Survey_id=request.QueryString("Survey_id")
CheckNum(Survey_id)
sql="select * from survey where Survey_id="&Survey_id&""
rs.open sql,conn,1,3
if rs.eof then
call ShowAlert("参数错误","")
else
%>
<form name="from1" action="SurveyAddSave.asp?action=editSurvey" method="post" onsubmit="return CheckForm();">
<input type="hidden" name="Survey_id" value="<%=Survey_id%>">
<table width="585" border="0" cellspacing="0" cellpadding="0" class="table">
  <tr>
    <th>问卷信息</th>
    <th width="">&nbsp;</th>
    <th width=""> 说明</th>
  </tr>
  <tr>
    <td>问卷名称</td>
    <td><input type="text" name="Survey_name"  value="<%=rs("Survey_name")%>"></td>
    <td width=""> &nbsp;&nbsp;问卷的名称，既问卷的总标题</td>
  </tr>
  <tr>
    <td>问卷发起人(单位)</td>
    <td><input type="text" name="Survey_author" value="<%=rs("Survey_author")%>"></td>
    <td width=""> &nbsp;&nbsp;问卷发起人，此问卷的所有单位</td>
  </tr>
  <tr>
    <td>问卷描述</td>
    <td><input type="text" name="Survey_description" value="<%=rs("Survey_description")%>"></td>
    <td width=""> &nbsp;&nbsp;对此问卷的简单描述 </td>
  </tr>
  <tr>
    <td>问卷结束日期</td>
    <td><input type="text" name="Survey_dateOver"   readOnly="" onClick="setDay(this);" value="<%=rs("Survey_dateOver")%>"></td>
    <td width=""> &nbsp;&nbsp;问卷结束日期，到期后该问卷将不能接受</td>
  </tr>
  <tr>
   <td>问卷采用模板</td>
   <td><select name="Survey_templet">
    <%
	   sqlstr="select * from templet where Templet_column=3"
	   rst.open sqlstr,conn,1,1
	   if rst.eof then 
	   I1 "<option value=""0"" selected>默认</option>"
	   else
	   while not rst.eof
		   if rs("Survey_templet")<>rst("Templet_id") then
		       if rst("Templet_default")=1 and rs("Survey_templet")=0 then
			   I1 "<option value="""&rst("Templet_id")&""" selected>"&rst("Templet_name")&"</option>"
			   else
			   I1 "<option value="""&rst("Templet_id")&""">"&rst("Templet_name")&"</option>"
			   end if
		   else
		   I1 "<option value="""&rst("Templet_id")&""" selected>"&rst("Templet_name")&"</option>"
		   end if
	   rst.movenext	   
	   wend
	   end if
	   rst.close
	   %>
   </select></td>
   <td>&nbsp;</td>
  </tr>
  <tr>
    <td>问卷编号</td>
    <td><input type="text" readonly="" value="<%=rs("Survey_code")%>"></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
   <td>问卷图片地址</td>
   <td><input name="Survey_img" type="text" value="<%=rs("Survey_img")%>" size="40"/></td>
   <td>&nbsp;</td>
  </tr>
  <tr>
    <td>应用问卷截断与跳转</td>
    <td>
	<%
	call SwitchCheckbox(rs("Survey_jdtz"),"Survey_jdtz")
	%>    </td>
    <td width=""><span class="R">*</span> 应用该功能后，问卷将采用每页显示一个问题的方式显示。</td>
  </tr>
  <tr>
    <td>同一IP可重复提交</td>
    <td>
	<%
	call SwitchCheckbox(rs("Survey_ipRepeat"),"Survey_ipRepeat")
	%>    </td>
    <td width="">&nbsp;&nbsp;选中此项，同一IP可重复提交问卷</td>
  </tr>
  <tr>
    <td>公开此问卷调查</td>
    <td>
	<%
	call SwitchCheckbox(rs("Survey_isOpen"),"Survey_isOpen")
	%></td>
    <td width=""> &nbsp;&nbsp;不公开的问卷，只能通过编号进行访问</td>
  </tr>
  <tr>
    <td>是否需要用户输入个人资料</td>
    <td width=""><%
	call SwitchCheckbox(rs("Survey_needUserInfo"),"Survey_needUserInfo")
	%></td>
    <td width="">  &nbsp; 选中后，用户在回答问卷前需要填写个人资料</td>
  </tr>
  <tr>
    <td>是否记录单个用户的问卷结果</td>
    <td width="">
	<%
	call SwitchCheckbox(rs("Survey_annal"),"Survey_annal")
	%></td>
    <td width=""> &nbsp;&nbsp;选中后，程序将保存每一位回答者的问卷结果。</td>
  </tr>
  <tr>
    <td>问卷密码</td>
    <td width=""><%
	if rs("Survey_password")<>"" then
	I1 "<input type=""checkbox"" checked=""true"" name=""Survey_isPassword"" value=""1""/>"
	I1 "该问卷须凭密码访问。"
	I1 "取消勾选则取消密码"
	else
	I1 "该问卷未设置密码。"
	I1 "重新设置密码："
	I1 "<input type=""checkbox"" name=""Survey_isPassword"" onClick=""SwitchHidden('hidden_isPassword');"" value=""1""/>"
	end if
	%>
    <div id="hidden_isPassword" style="display:none;">
       输入密码：<input type="password" name="Survey_Password1" id="Survey_Password1"><br/>
       确认密码：<input type="password" name="Survey_Password2" id="Survey_Password2" onblur="return CheckPassword('Survey_Password1','Survey_Password2','4');">
    </div>    </td>
    <td width=""> &nbsp;&nbsp;选中此项，只有输入正确的密码才能完成问卷</td>
  </tr>
  <tr>
    <td>访问IP限制</td>
    <td width="">
	<%
	select case rs("Survey_ipLimitKind")
	  case "bai"
	  response.Write("以下IP段可访问<br/>")
	  case "hei"
	  response.Write("以下IP段不可访问<br/>")
	  case else
	  response.Write("未设置IP段访问限制")  
	end select
	if not (rs("Survey_ipStart")="" and rs("Survey_ipEnd")="") then
	Survey_ipStart=split(rs("Survey_ipStart"),",")
	Survey_ipEnd=split(rs("Survey_ipEnd"),",")
	for i=0 to ubound(Survey_ipStart)
	response.Write(Survey_ipStart(i)&"---"&Survey_ipEnd(i)&"<br/>")
	next
	end if
	%>	</td>
    <td width="">&nbsp;&nbsp;设置此项，对问卷访问者进行IP限制</td>
  </tr>  
  <tr>
    <td>问卷被访问数</td>
    <td width=""><%=rs("Survey_hits")%></td>
    <td width="">&nbsp;</td>
  </tr>
  <tr>
    <td>有效问卷数</td>
    <td width=""><%=rs("Survey_usehits")%></td>
    <td width="">&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td width="">
	<div id="button">
	<input type="submit" name="submit" value="修改"><input type="reset" name="reset1" value="取消"><input type="button" name="button1" onclick="location.href='SurveyAdmin.asp'" value="返回">
	</div>	</td>
    <td width="">&nbsp;</td>
  </tr>
</table>  
</form>
<%
end if
rs.close
%>
</div>
<div id="admin_surveyAdd_bottom">
</div>
</body>
</html>
